import { html } from '@codemirror/lang-html'
import { java } from '@codemirror/lang-java'
import { javascript } from '@codemirror/lang-javascript'
import { json, jsonParseLinter } from '@codemirror/lang-json'
import { markdown } from '@codemirror/lang-markdown'
import { sql } from '@codemirror/lang-sql'
import { linter } from '@codemirror/lint'

export const langMap = {
  json: {
    lang: json,
    linter: () => {
      return linter(jsonParseLinter())
    },
  },
  javascript: {
    lang: javascript,
    linter: undefined,
  },
  java: {
    lang: java,
    linter: undefined,
  },
  sql: {
    lang: sql,
    linter: undefined,
  },
  html: {
    lang: html,
    linter: undefined,
  },
  markdown: {
    lang: markdown,
    linter: undefined,
  },
}
